<include file="public@header"/>
</head>
<body>
<div class="wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a>流水明细</a></li>
    </ul>
    <form class="well form-inline margin-top-20" method="post" action="{:url('pay/moneylog/index')}">
        时间:
        <input type="text" class="form-control js-bootstrap-datetime" name="start_time"
               value="{$start_time|default=''}"
               style="width: 140px;" autocomplete="off">-
        <input type="text" class="form-control js-bootstrap-datetime" name="end_time"
               value="{$end_time|default=''}"
               style="width: 140px;" autocomplete="off"> &nbsp; &nbsp;
        账号:
        <input type="text" class="form-control" name="user_login" style="width: 200px;"
               value="{$user_login|default=''}" placeholder="请输入关键字..."> &nbsp; &nbsp;
        类型:
        <select class="form-control" name="type" style="width: 140px;">
            <option<if $type==''> selected </if> value=''>全部</option>
            <option<if $type=='1'> selected </if> value='1'>充值</option>
            <option<if $type=='2'> selected </if> value='2'>提现</option>
            <option<if $type=='3'> selected </if> value='3'>购买产品</option>
            <option<if $type=='4'> selected </if> value='4'>产品反利</option>
            <option<if $type=='5'> selected </if> value='5'>游戏</option>
            <option<if $type=='6'> selected </if> value='6'>分销</option>
            <option<if $type=='7'> selected </if> value='7'>平仓</option>
            <option<if $type=='8'> selected </if> value='8'>产品收益</option>
        </select> &nbsp;&nbsp;
        <input type="submit" class="btn btn-primary" value="搜索"/>
        <a class="btn btn-danger" href="{:url('pay/moneylog/index')}">清空</a>
    </form>
    <php>
        $type = [1 => '充值', 2 => '提现', 3 => '购买产品', 4 => '产品反利', 5 => '游戏', 6 => '分销', 7 => '平仓', 8 => '产品收益'];
    </php>
    <form class="js-ajax-form" action="" method="post">
        <table class="table table-hover table-bordered table-list">
            <thead>
            <tr>
                <th width="50">ID</th>
                <th>账号</th>
                <th>类型</th>
                <th>之前金额</th>
                <th>金额</th>
                <th>之后金额</th>
                <th>描述信息</th>
                <th>创建时间</th>
                <th width="15%">操作</th>
            </tr>
            </thead>
            <foreach name="list" item="vo">
                <tr>
                    <td><b>{$vo.id}</b></td>
                    <td>{$vo.user_login}</td>
                    <td>{$type[$vo['type']]}</td>
                    <td>{$vo.before_amount}</td>
                    <td>{$vo.money}</td>
                    <td>{$vo.after_amount}</td>
                    <td>{$vo['notice']}</td>
                    <td>{$vo['create_time']}</td>
                    <td>
                        <a class="btn btn-xs btn-danger js-ajax-delete"
                           href="{:url('pay/moneylog/delete',array('id'=>$vo['id']))}">{:lang('DELETE')}</a>
                    </td>
                </tr>
            </foreach>
        </table>
        <ul class="pagination">{$page|default=''}</ul>
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script src="__STATIC__/js/layer/layer.js"></script>
<script>

    function methodAction(url, title, options) {
        var index = layer.open({
            type: 2,
            title: title,
            area: ['700px', '450px'],
            fixed: false, //不固定
            maxmin: true,
            content: url,
            // end: function () {
            //     reloadPage(window);
            // }
        });
    }

    function methodActions(url, title, options) {
        var index = layer.open({
            type: 2,
            title: title,
            area: ['500px', '300px'],
            fixed: false, //不固定
            maxmin: true,
            content: url,
            // end: function () {
            //     reloadPage(window);
            // }
        });
    }

    function reloadPage(win) {
        win.location.reload();
    }

    $(function () {
        setCookie("refersh_time", 0);
        Wind.use('ajaxForm', 'artDialog', 'iframeTools', function () {
            //批量复制
            $('.js-articles-copy').click(function (e) {
                var ids = [];
                $("input[name='ids[]']").each(function () {
                    if ($(this).is(':checked')) {
                        ids.push($(this).val());
                    }
                });

                if (ids.length == 0) {
                    art.dialog.through({
                        id: 'error',
                        icon: 'error',
                        content: '您没有勾选信息，无法进行操作！',
                        cancelVal: '关闭',
                        cancel: true
                    });
                    return false;
                }

                ids = ids.join(',');
                art.dialog.open("__ROOT__/index.php?g=portal&m=AdminArticle&a=copy&ids=" + ids, {
                    title: "批量复制",
                    width: "300px"
                });
            });
            //批量移动
            $('.js-articles-move').click(function (e) {
                var ids = [];
                $("input[name='ids[]']").each(function () {
                    if ($(this).is(':checked')) {
                        ids.push($(this).val());
                    }
                });

                if (ids.length == 0) {
                    art.dialog.through({
                        id: 'error',
                        icon: 'error',
                        content: '您没有勾选信息，无法进行操作！',
                        cancelVal: '关闭',
                        cancel: true
                    });
                    return false;
                }

                ids = ids.join(',');
                art.dialog.open("__ROOT__/index.php?g=portal&m=AdminArticle&a=move&old_term_id={$term.term_id|default=0}&ids=" + ids, {
                    title: "批量移动",
                    width: "300px"
                });
            });
        });
    });

</script>
</body>
</html>